package com.sharemedia.utils
{
	import mx.styles.CSSStyleDeclaration;
	import mx.styles.StyleManager;

	public class SkinUtil
	{
		/**
		 * This static function needs to set default styles to the component 
		 * without creating separate css file.
		 */
		public static function setSkin(targetClass:String, skinClass:Class):void
		{
			var styles:CSSStyleDeclaration = StyleManager.getStyleManager(null).getStyleDeclaration(targetClass);
			if(!styles)
				styles = new CSSStyleDeclaration();
			
			styles.defaultFactory = function():void
			{	
				// default styles for the component
				this.skinClass = skinClass;
			}
			StyleManager.getStyleManager(null).setStyleDeclaration(targetClass, styles, false);
		}
	}
}